const app = getApp()
const CONFIG = app.globalData.config;

Page({

    data: {
        imgUrl: app.globalData.imgUrl,
        isAndroid: app.globalData.sysType === 'ANDROID',
        bannerList: [{
                id: 1,
                img: `${app.globalData.imgUrl}/index/temp_banner_img.jpg`
            }, {
                id: 2,
                img: `${app.globalData.imgUrl}/index/temp_banner_img.jpg`
            }, {
                id: 3,
                img: `${app.globalData.imgUrl}/index/temp_banner_img.jpg`
            }
        ],
        classifyList: [{
                id: 1,
                url: '/pages/logs/logs',
                img: `${app.globalData.imgUrl}/index/temp_classify_img.jpg`
            }, {
                id: 2,
                url: '/pages/logs/logs',
                img: `${app.globalData.imgUrl}/index/temp_classify_img.jpg`
            }, {
                id: 3,
                url: '/pages/logs/logs',
                img: `${app.globalData.imgUrl}/index/temp_classify_img.jpg`
            }, {
                id: 4,
                url: '/pages/logs/logs',
                img: `${app.globalData.imgUrl}/index/temp_classify_img.jpg`
            }, {
                id: 5,
                url: '/pages/logs/logs',
                img: `${app.globalData.imgUrl}/index/temp_classify_img.jpg`
            }, {
                id: 6,
                url: '/pages/logs/logs',
                img: `${app.globalData.imgUrl}/index/temp_classify_img.jpg`
            }, {
                id: 7,
                url: '/pages/logs/logs',
                img: `${app.globalData.imgUrl}/index/temp_classify_img.jpg`
            }, {
                id: 8,
                url: '/pages/logs/logs',
                img: `${app.globalData.imgUrl}/index/temp_classify_img.jpg`
            }
        ]
    },
    
    onLoad: function () {
        this.setData({
            list: wx.getStorageSync("GOODS_LIST")
        })
        app.wxRequest({
            interfaceName: CONFIG.interfaceList.GET_SPECIAL_GOODS_LIST,
            reqData: {
                groupId: '11',
                pageIndex: '1',
                pageSize: CONFIG.PAGE_SIZE,
                goodsSpeciaType: '1'
            }
        }).then((res) => {
            this.setData({
                list: res.data
            });
            wx.setStorageSync("GOODS_LIST", res.data);
        })
        
    },

    onShow: function() {
    },
})
